#pragma once

#include <algorithm>
#include <string>

class Target
{
public:
    Target()          = default;
    virtual ~Target() = default;

public:
    virtual std::string request() const
    {
        return "Target: The default target's behavior.";
    }
};

class Adaptee
{
public:
    std::string specificRequest() const
    {
        return ".eetpadA eht fo roivaheb laicepS";
    }
};

class Adapter : public Target
{
private:
    Adaptee *m_adaptee;

public:
    Adapter(Adaptee *adaptee) : m_adaptee(adaptee){};

public:
    std::string request() const override
    {
        std::string to_reverse = this->m_adaptee->specificRequest();
        std::reverse(to_reverse.begin(), to_reverse.end());
        return "Adapter: (TRANSLATED) " + to_reverse;
    }
};